<?php
/**
 *@author Connor <caokang@foxmail.com>
 *@todo
 *@link www.zeevin.com
 */?>
 <div class="title">
 	<ul style="float:left;">
 		<li <?php if($_GET['b']=='1'):?>class="current"<?php endif;?>><a href="?r=home/friend&b=1" title="我的好友">我的好友</a></li>
 		<li <?php if($_GET['b']=='2'):?>class="current"<?php endif;?>><a href="?r=home/friend&s=1&b=2" title="我关注的">我关注的</a></li>
 		<li <?php if($_GET['b']=='3'):?>class="current"<?php endif;?>><a href="?r=home/friend&s=2&b=3" title="关注我的">关注我的</a></li>
 		<li <?php if($_GET['b']=='4'):?>class="current"<?php endif;?>><a href="?r=home/blist&b=4" title="黑名单">黑名单</a></li>
 	</ul>
 </div>
 <div class="main_content">
 	<div class="friends">
 		<div class="black_list">
 			<ul>
 				<?php if($blacks['total_num']):
 				foreach($blacks['rows'] as $v):
 					$user = User::model()->findByPk($v->bid);?>
 				<li id='li_<?php echo $v->id?>'>
 					<a href="#" title="<?php echo $user->nickname;?>"><img src="<?php echo Utils::getAvatar($user->avatar);?>" width="67" height="68" alt="<?php echo $user->nickname;?>"/></a> 
 					<p><?php echo $user->nickname;?></p>
 					<img src="images/block_close.gif" width="7" height="8" tag="<?php echo $v->id;?>" class="close"/> 
 				</li>
 			<?php endforeach;else:?>
 			<li><p>无信息</p></li>
 		<?php endif;?>

 	</ul>
 </div>
 <div class="page">
 	<?php $this->widget('ZLinkPager', array('pages' => $friends['pages'])); ?>
 </div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
	$('.close').click(function(){
		var id = $(this).attr('tag');
		if(confirm("确定从黑名单中删除？")){
		$.post('?r=home/blist',{id:id},function(data){
			data = $.parseJSON(data);
			if(data.status=='0'){
				$('#li_'+id).remove();
			}else
				alert(data.desc);
		});
	}
	})
})
</script>